-- GENERATED SPELL FOR [Nexus-King Salhadaar] --


function spell0_20454(pUnit, Event) --@Gravity Flux,Self--
pUnit:FullCastSpellOnTarget(36533,pUnit)
pUnit:RegisterEvent('Sorts_20454', 2500, 1)
end

function spell1_20454(pUnit, Event) --@Mirror Image,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(36847,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_20454', 1, 1)
end

function spell2_20454(pUnit, Event) --@Mirror Image,n/a--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(36848,pUnit:GetMainTank ())
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_20454', 1, 1)
end

function spell3_20454(pUnit, Event) --@Stasis,n/a--
pUnit:FullCastSpellOnTarget(36527,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20454', 6325, 1)
end

function Sorts_20454(pUnit, Event)
local choix_sorts_20454 = math.random(0, 3)
if choix_sorts_20454 == 0 then
pUnit:RegisterEvent('spell0_20454', 1, 1)
end
if choix_sorts_20454 == 1 then
pUnit:RegisterEvent('spell1_20454', 1, 1)
end
if choix_sorts_20454 == 2 then
pUnit:RegisterEvent('spell2_20454', 1, 1)
end
if choix_sorts_20454 == 3 then
pUnit:RegisterEvent('spell3_20454', 1, 1)
end
end

function mob20454_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20454', math.random(1500, 3000), 1)
end

function mob20454_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20454_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20454_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20454, 1, 'mob20454_Action')
RegisterUnitEvent(20454, 2, 'mob20454_Leave')
RegisterUnitEvent(20454, 3, 'mob20454_Kill')
RegisterUnitEvent(20454, 4, 'mob20454_Die')
